package com.coderfans.databole.model;

import com.coderfans.htmlpaser.model.IModel;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by 58-daojia on 2017-12-27.
 *
 * @author: fanchunshuai
 * @version: V1.0
 * @Desc:
 * @Copyright (c) 2017 58到家-版权所有
 */
public class BoleBlogModel  extends IModel{

    private Long id;

    //伯乐在线用户id
    private Long userId;

    //博客作者
    private String authorName;

    //源博客地址
    private String sourceLink;

    //博客地址（伯乐）
    private String blogUrl;

    //博客标题
    private String blogTitle;

    //发布日期
    private Date publishDate;

    //评论数量
    private Integer commentNum;

    //相似文章
    private String simpleLinks;

    //博客标签
    private String blogTags;

    //博客分类
    private String blogCategory;

    //博客属性
    private String blogType;

    //伯乐用户转载用户名
    private String boleUserName;


    @Override
    public Map<String, String> getXpathMap() {
        Map<String,String>  map = new HashMap<>();
        map.put("blogTitle","/*//*[@id='post-$']/div[1]/h1/text()");
        map.put("authorName","//*[@id='post-$']/div[3]/div[1]/a/text()");
        map.put("publishDate","//*[@id='post-$']/div[2]/p/text()");
        map.put("blogCategory","//*[@id='post-$']/div[2]/p/a[1]/text()");
        map.put("sourceLink","*//*//**//*[@id='post-$']/div[3]/div[1]/a/@href");

        return map;
    }

    public String getBoleUserName() {
        return boleUserName;
    }

    public void setBoleUserName(String boleUserName) {
        this.boleUserName = boleUserName;
    }

    public String getBlogType() {
        return blogType;
    }

    public void setBlogType(String blogType) {
        this.blogType = blogType;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getSourceLink() {
        return sourceLink;
    }

    public void setSourceLink(String sourceLink) {
        this.sourceLink = sourceLink;
    }

    public String getBlogUrl() {
        return blogUrl;
    }

    public void setBlogUrl(String blogUrl) {
        this.blogUrl = blogUrl;
    }

    public String getBlogTitle() {
        return blogTitle;
    }

    public void setBlogTitle(String blogTitle) {
        this.blogTitle = blogTitle;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public Integer getCommentNum() {
        return commentNum;
    }

    public void setCommentNum(Integer commentNum) {
        this.commentNum = commentNum;
    }

    public String getSimpleLinks() {
        return simpleLinks;
    }

    public void setSimpleLinks(String simpleLinks) {
        this.simpleLinks = simpleLinks;
    }

    public String getBlogTags() {
        return blogTags;
    }

    public void setBlogTags(String blogTags) {
        this.blogTags = blogTags;
    }

    public String getBlogCategory() {
        return blogCategory;
    }

    public void setBlogCategory(String blogCategory) {
        this.blogCategory = blogCategory;
    }


    @Override
    public String toString() {
        return "BoleBlogModel{" +
                "id=" + id +
                ", userId=" + userId +
                ", authorName='" + authorName + '\'' +
                ", sourceLink='" + sourceLink + '\'' +
                ", blogUrl='" + blogUrl + '\'' +
                ", blogTitle='" + blogTitle + '\'' +
                ", publishDate=" + publishDate +
                ", commentNum=" + commentNum +
                ", simpleLinks='" + simpleLinks + '\'' +
                ", blogTags='" + blogTags + '\'' +
                ", blogCategory='" + blogCategory + '\'' +
                ", blogType='" + blogType + '\'' +
                ", boleUserName='" + boleUserName + '\'' +
                '}';
    }
}
